#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
    string multiply(string num1, string num2) {
        int n1 = 0;
        for (size_t i = 0; i < num1.size(); i++) {
            n1 = (n1 * 10) + (num1[i] - '0');
        }
        int n2 = 0;
        int sum = 0;
        int nn = 1;
        for (int i = num2.size() - 1; i >= 0; i--) {
            n2 = n1 * (num2[i] - '0');
            sum += n2 * nn;
            nn *= 10;
        }
        string s;
        while (sum > 0) {
            s += (sum % 10) + '0';
            sum /= 10;
        }
        reverse(s.begin(), s.end());
        return s;
    }
};

int main() {
    string s1("123");
    string s2("456");
    Solution s;
    cout<< s.multiply(s1, s2) << endl;
}

